package com.example.pageheplerdemo.service.impl;

import com.example.pageheplerdemo.dao.UserDao;
import com.example.pageheplerdemo.model.User;
import com.example.pageheplerdemo.service.UserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author jason.tang
 * @Date 2019-09-22 21:49
 * @Desc
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public PageInfo<User> getUserList(PageInfo pageInfo) {
        PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
        List<User> users = userDao.getUserList();
        return new PageInfo<>(users);
    }
}
